/* jshint indent: 2 */

module.exports = function (sequelize, DataTypes) {
    return sequelize.define('business_details', {
        businessId: {
            type: DataTypes.INTEGER(3),
            allowNull: false,
            primaryKey: true,
            autoIncrement: true
        },
        busName: {
            type: DataTypes.STRING(255),
            allowNull: false,
            defaultValue: ''
        },
        busNameEn: {
            type: DataTypes.STRING(255),
            allowNull: true
        },
        desc: {
            type: DataTypes.STRING(1000),
            allowNull: true
        },
        update_time: {
            type: DataTypes.DATE,
            allowNull: false
        },
        create_time: {
            type: DataTypes.DATE,
            allowNull: false,
            defaultValue: sequelize.literal('CURRENT_TIMESTAMP')
        },
        isValid: {
            type: DataTypes.INTEGER(1),
            allowNull: false,
            defaultValue: '0'
        }
    }, {
        tableName: 'business_details',
        timestamps: false
    });
};
